package com.edocbase.desktopserver.util;

import java.io.IOException;
import java.util.Properties;

public class MimeTypes {
	private static Properties types = null;
	
	public static String getType(String ext){
		String type = "";
		if (types == null){
			types = new Properties();
			try {
				types
				.load(MimeTypes.class.getClassLoader().getResourceAsStream(
						"com/edocbase/desktopserver/util/mime-types.properties"));
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		if (types.containsKey(ext)){
			type = types.getProperty(ext);
		}
		return type;
	}
}
